/**
 * 
 */
$(function(){
	$('.login').hide();
	$('.setting-box').hide();
	$('.lable-login, .setting').live('click',function() {
		$('.login').slideToggle();
		$('.setting-box').slideToggle();
	});
	$('.delete-item').live('click',function() {
		return confirm('Are you sure want to delete this item?');
	});
	$('.img-popup').live('click',function() {
		var url = $(this).attr('src');
		window.open(url, null, "width=600, height=500, scrollbars=yes");
	     return false;
	});
	$('.image-edit').hide();
	$('.cancel').hide();
	$('.img-change').live('click',function() {
		$(this).hide();
		$('.image-edit').show();
		$('.cancel').show();
		return false;
	});
	$('.cancel').live('click',function() {
		$(this).hide();
		$('.image-edit').hide();
		$('.img-change').show();
		return false;
	});
	
	$('#password').attr('disabled', 'disabled');
	$('#password').css("background-color","#ccc");
	$('.changepassword').live('click',function() {
		if($(this).val()==1) {
			var $elem = $('#password');
			$elem.removeAttr('disabled');
			$elem.css("background-color","white");
			$elem.focus();
	        $elem.select().mouseup(function (e) {
	            e.preventDefault();
	            $elem.unbind(e.type);
	        });
		}
		else {
			$('#password').attr('disabled', 'disabled');
			$('#password').css("background-color","#ccc");
		}
	});
	
	$('.submenu').hide();
	$('.parent').mouseover(function() {
        $(this).find('.submenu').show();
    }).mouseout(function() {
    	$(this).find('.submenu').hide();
    });
	
	/* $('#frm-changepassword').submit(function(e){
        if($('#currentpassword').val()=="" || $('#currentpassword').val()==null) {
        	$('.currentmessage').text('Current password required!');
        	return false;
        }
    });*/
});